package com.team.util;

import io.swagger.annotations.ApiModelProperty;

import java.util.List;

public class AllRecordsVo<T> {
	@ApiModelProperty("当前页")
	private Integer pageIndex;
	@ApiModelProperty("每页大小")
	private Integer pageSize;
	@ApiModelProperty("总页数")
	private Integer totalPage;
	@ApiModelProperty("总条数")
	private Integer totalNumber;
	@ApiModelProperty("数据")
	private List<T> dataList;
	public Integer getPageIndex() {
		return pageIndex;
	}
	public void setPageIndex(Integer pageIndex) {
		this.pageIndex = pageIndex;
	}
	public Integer getPageSize() {
		return pageSize;
	}
	public void setPageSize(Integer pageSize) {
		this.pageSize = pageSize;
	}
	public Integer getTotalPage() {
		return totalPage;
	}
	public void setTotalPage(Integer totalPage) {
		this.totalPage = totalPage;
	}
	public Integer getTotalNumber() {
		return totalNumber;
	}
	public void setTotalNumber(Integer totalNumber) {
		this.totalNumber = totalNumber;
	}
	public List<T> getDataList() {
		return dataList;
	}
	public void setDataList(List<T> dataList) {
		this.dataList = dataList;
	}
	//计算总页数
	public Integer countPage(Integer count){
		int totalPage = count/pageSize;

        if(count % pageSize != 0L) {  /*11%10 !=0*/
        	return ++totalPage;
//        	++i;
//        	i++;
        }
		return totalPage;
	}
	
}
